<?php

namespace App\Request\Setting;

use App\Request\BaseCommonRequest;
use Hyperf\Context\Context;
use Hyperf\Validation\Request\FormRequest;

class AcceptVideoRequest extends BaseCommonRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }


    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'type' => 'required|in:0,1',
            'accept_type' => 'required'
        ];
    }


    public function messages(): array
    {
        $language = Context::get('language');
        if ($language == 'zh-zn') {
            return [
                'language.required' => '语言选项必填',
                'language.in' => '语言选项仅支持：中文、英文、繁体中文',
            ];
        } elseif ($language == 'zh-hk') {
            return [
                'language.required' => '語言選項必填',
                'language.in' => '語言選項僅支持：中文、英文、繁體中文',
            ];
        } else {
            return [
                'language.required' => 'Language option is required',
                'language.in' => 'Language option only supports: Chinese, English, Traditional Chinese',
            ];
        }
    }
}